<html>
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
   
      <link rel="stylesheet" href="./../helpwin.css">
      <title>MATLAB File Help: prtDistanceEarthMover</title>
   </head>
   <body>
      <!--Single-page help-->
      <table border="0" cellspacing="0" width="100%">
         <tr class="subheader">
            <td class="headertitle">MATLAB File Help: prtDistanceEarthMover</td>
            
            
         </tr>
      </table>
      <div class="title">prtDistanceEarthMover</div>
      <div class="helptext"><pre><!--helptext -->  <span class="helptopic">prtDistanceEarthMover</span>   Earth mover distance
 
    DIST = <span class="helptopic">prtDistanceEarthMover</span>(DS1,DS2) calculates the Earth Mover
    distance from all the observations in DS1 to DS2, and ouputs a distance
    matrix of size DS1.nObservations x DS2.nObservations.  DS1 and DS2
    should be prtDataSet objecgts. The covariance matrix in the Mahalanobis
    is estimated from both the data in DS1 and DS2. DS1 and DS2 should have
    the same number of features. <span class="helptopic">prtDistanceEarthMover</span> assumes that columns
    represent weights for equally spaced points at locations
    1:dataSet.nFeatures.
    
    Earth mover's distance requires that the values in d1 and d2 are
    positive, and they should have constant row sums for the distance to be
    meaningful.
 
    DIST = <span class="helptopic">prtDistanceEarthMover</span>(DS1,DS2,X1,X2) where X1 and 
    X2 are double matrices of size dataSet1.nObservations x
    dataSet1.nFeatures and dataSet2.nObservations x dataSet2.nFeatures
    allows the user to specify the locations of the points in each of the
    data sets.
 
    For more information, see:
    
    <a href="http://en.wikipedia.org/wiki/Earth_mover's_distance">http://en.wikipedia.org/wiki/Earth_mover's_distance</a>
 
    See also: Rubner, Tomasi, Guibas.  The Earth Mover's Distance as a Metric
    for Image Retrieval. 
 
 
    Example:
 
        d = rand(5,3);                    % Generate some random data
        d = bsxfun(@rdivide,d,sum(d,2));   % Normalize
 
        % Store data in prtDataSetStandard
        DS = prtDataSetStandard('Observations',d);
        % Compute distance
        distance = <span class="helptopic">prtDistanceEarthMover</span>(DS,DS);</pre></div><!--after help --><!--seeAlso--><div class="footerlinktitle">See also</div><div class="footerlink"> <a href="./prtDistanceCityBlock.html">prtDistanceCityBlock</a>, <a href="./prtDistanceLNorm.html">prtDistanceLNorm</a>, <a href="./prtDistanceEuclidean.html">prtDistanceEuclidean</a>,
  <a href="./prtDistanceSquare.html">prtDistanceSquare</a>, <a href="./prtDistanceChebychev.html">prtDistanceChebychev</a>
</div>
   </body>
</html>